'use client';
import { useSentryUncaughtErrors } from '@akinon/next/hooks';
import PzErrorPage from '@akinon/next/views/error-page';
import { useErrorComposition } from '@akinon/pz-theme/src/chrome/error-composition';
import ThemePlaceholderClient from '@akinon/pz-theme/src/theme-placeholder-client';
import { ThemePageContextProvider } from '@akinon/pz-theme/src/theme-page-context';
import { ThemeSettingsProvider } from '@akinon/pz-theme/src/theme-settings-context';
export default function ErrorPage({
error,
reset
}: {
error: Error & { digest?: string; isServerError?: boolean };
reset: () => void;
}) {
// DO NOT REMOVE THIS LINE TO REPORT UNCAUGHT ERRORS TO SENTRY
useSentryUncaughtErrors(error);
// Prefetched by the layout provider before anything failed; null until a
// designer composes the server-error placeholder in the theme editor.
const composition = useErrorComposition();
if (composition) {
return (
<>
{composition.themeCSS && (
)}
>
);
}
return ;
}